package cn.bgs.service.impl;

import cn.bgs.dao.AnimalMapper;
import cn.bgs.pojo.Animal;
import cn.bgs.service.AnimalService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AnimalServiceImpl implements AnimalService {

  @Autowired
  private AnimalMapper animalMapper;


  @Override
  public PageInfo<Animal> findAll(Integer pageNum, Integer pageSiz) {

       PageHelper.startPage(pageNum,pageSiz);

       List<Animal> list=animalMapper.findAll();
       PageInfo<Animal> ff= new PageInfo<>(list);

       return ff;

  }

    @Override
    public Animal selectByPrimaryKey(Integer id) {
        return animalMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Animal record) {
        return animalMapper.updateByPrimaryKeySelective(record);
    }


}
